#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

void solve() {
    int n;
    cin >> n;
    ll sum1 = 0, sum2 = 0;
    vector<int> a(n), b(n);
    for(int i = 0; i < n; i++) cin >> a[i], sum1 += a[i];
    for(int i = 0; i < n; i++) cin >> b[i], sum2 += a[i];
    ll t1 = *max_element(a.begin(), a.end());
    ll t2 = *max_element(b.begin(), b.end());
    cout << max(sum1 + n * t2, sum2 + n * t1) << endl;
}

int main() {
    int t;
    cin >> t;
    while(t--) solve();
    return 0;
}